<!-- Load TinyMCE -->
<script type="text/javascript" src="media/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="media/tiny_mce/config.js"></script>
<script type="text/javascript" src="media/js/jquery.validate.min.js"></script>
<script type="text/javascript">
tiny('detail[th],detail[en]');
$(function(){
	$("#frmMain").validate({
		rules: 
		{
			"title": 
			{ 
				required: true
			}
		},
		messages:
		{
			"title": 
			{ 
				required: "กรุณากรอกหัวข้อค่ะ"
			}
		}
	});
	
	$("[rel=en]").hide();
	$(".lang a").click(function(){
		$("[rel=" + $(this).attr("href") + "]").show().siblings().hide();
		$(this).addClass('active').siblings().removeClass('active');
		return false;
	})
})
</script>
<h1>ความเป็นมา</h1>
<form id="frmMain" action="history_pages/admin/history_pages/save/<?php echo $information->id ?>" method="post" enctype="multipart/form-data" >
	
<table class="form">
	<tr class="trlang"><th></th><td class="lang"><a href="th" class="active flag th">ไทย</a><a href="en" class="flag en">อังกฤษ</a></td></tr>
	<tr>
		<th></th>
		<td>
			<?php if($information->image != ""):?><?php echo thumb("uploads/information/".$information->image,120,70,1);?><?php endif;?>
		</td>
	</tr>
	<tr><th>รูปภาพ :</th><td><input type="file" name="image" /></td></tr>
	<!-- <tr><th>หมวดหมู่ :</th><td><?php echo form_dropdown('category_id',$information->category->get_option(),$information->category_id,'');?></td></tr> -->
	<tr>
		<th>หัวข้อ :</th>
		<td>
			<input type="text" name="title[th]" rel="th" value="<?php echo lang_decode($information->title,'th')?>" class="full" />
			<input type="text" name="title[en]" rel="en" value="<?php echo lang_decode($information->title,'en')?>" class="full" />
		</td>
	</tr>
	<tr>
		<th>รายละเอียด :</th>
		<td>
			<div rel="th"><textarea name="detail[th]" class="full tinymce"><?php echo lang_decode($information->detail,'th')?></textarea></div>
			<div rel="en"><textarea name="detail[en]" class="full tinymce"><?php echo lang_decode($information->detail,'en')?></textarea></div>
		</td>
	</tr>
	<!--
	<tr><th>เริ่ม :</th><td><input type="text" name="start_date" value="<?php echo DB2Date(($information->start_date)?$information->start_date:date("Y-m-d"))?>" class="datepicker" /></td></tr>
	<tr><th>สิ้นสุด :</th><td><input type="text" name="end_date" value="<?php echo DB2Date($information->end_date)?>" class="datepicker" /></td></tr> -->
	<?php if(permission('history_pages', 'update')):?>
	<tr><th></th><td><input type="submit" value="บันทึก" /><!-- <?php echo form_back() ?> --></td></tr>
	<?php endif;?>
</table>
<!-- <?php echo form_referer() ?> -->
</form>